package com.mi.system.dto.request;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.mi.common.core.jackson.LongArrayDeserializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;

/**
 * Role request DTO
 *
 * @author jin_huaquan
 * @version 1.0
 * @date 2021/11/2 9:09
 */
@ApiModel(value = "RoleRequestDTO对象", description = "角色请求信息")
@Data
public class RoleRequestDTO {

    @ApiModelProperty(value = "角色名称", required = true)
    @NotBlank(message = "角色名称不能为空")
    @Length(min = 1, max = 32, message = "角色名称不能超过32个字符")
    private String name;

    @ApiModelProperty(value = "角色标识", required = true)
    @NotBlank(message = "角色标识不能为空")
    @Length(min = 1, max = 64, message = "角色标识不能超过64个字符")
    private String roleCode;

    @ApiModelProperty("角色描述")
    @Length(max = 255, message = "角色描述不能超过255个字符")
    private String remarks;

    @ApiModelProperty(value = "角色分配的权限菜单集", dataType = "[Ljava.lang.String;")
    @JsonDeserialize(using = LongArrayDeserializer.class)
    private Long[] menuIds;
}